﻿@inherits Vowei.Web.G18nWebViewPage<IEnumerable<Vowei.Core.Models.Requirement>>
@using Vowei.Web.Models
@using Vowei.Web.Helpers
@using Vowei.Core.Models;
@using System.Web.Mvc.Html 

@{    
    var milestone = ViewData["Project"] as Milestone;
    if (milestone != null)
    {
        ViewBag.Title = string.Format(T("[{0}] 里的需求列表"), milestone.Title);
    }
    else
    {
        ViewBag.Title = T("需求列表");
    }
        
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@ViewBag.Title</h2>
<table id="@WebConstants.TicketsTableId" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            @T(r => r.First().Title)
        </td>
        <td>
            @T(r => r.First().BusinessValue)
        </td>
        <td>
            @T(r => r.First().AssignedTo)
        </td>
        <td class="row_pk">@T(r => r.First().ID)</td>
        <td class="row_pk">@T("类型")</td>
        <td class="row_pk">@T(r => r.First().BelongsToMilestone)</td>
    </tr>
	
    @foreach ( var req in Model )
    {
    <tr>
        <td>
            <a href="/Requirement/Details/@req.ID">@req.Title</a>
        </td>
        <td>
            @T(req.BusinessValue)
        </td>
        <td>
            @req.AssignedTo
        </td>
        <td class="row_pk">
            @req.ID
        </td>
        <td class="row_pk">
            @T("需求")
        </td>
        <td class="row_pk">
            @req.BelongsToMilestoneId
        </td>
    </tr>  
    }

</table>

<p>
    @if ( milestone != null ) 
    {
        var pid = milestone.ID;
        Html.ActionLink(string.Format(T("在 [{0}] 中创建新需求"), milestone.Title), "CreateIn", new { project = pid });
    }
    | <a href="/Ticket/ExportToExcel/?title=@Server.UrlEncode(ViewBag.Title)">@T("导出到Excel")</a>
</p>